<template>
  <CommonPage title="操作日志">
    <!-- <template #mid>
      <SearchForm>
        <template #extraButtons>
          <a-button type="primary" @click="showCreate">新增系统参数</a-button>
        </template>
      </SearchForm>
    </template> -->
    <SlTable :columns="columns" row-key="id" :data-source="tableData" :pagination="pagination" :loading="tableLoading">
    </SlTable>
    <!-- <CURDDialog
      ref="CURDModalIns"
      id-key="id"
      :columns="columns"
      create-title="新增菜单"
      update-title="编辑菜单"
      delete-message="确认删除该菜单吗？"
      :show-options="showOptions"
      :model="model"
      :model-form-setting="modelFormSetting"
      :model-rules="modelRules"
      :table-data="tableData"
      :oper-data="operData"
      :curd="curd"
      :reload-table="reloadTable"
      :delete-url-suffix-mode="1"
      @before-ok="beforeOk"
      @open="open"
    /> -->
  </CommonPage>
</template>
<script lang="ts" setup>
import { ref, shallowRef } from "vue";
import { useI18n } from "/@/locales/useI18n";
import { useCURD } from "/@/hooks/useCURD";
import { FormItemComponentType, CURDAction, CURDDialogExpose } from "/@/components/CURDDialog/models";
import type { FormItemData, OperItem, ShowCURDModalOptions, CURDModalEvent } from "/@/components/CURDDialog/models";
import type { TableProps } from "ant-design-vue";
import { PatternKey } from "/@/utils/verify";
import { Api } from "/@/api/home/menu";
import { MenuItem, MenuType } from "/@/api/home/menu/models";
import { handleMenuSort } from "/@/stores/menu";
import { loopItem } from "/@/utils/treeData";
import dayjs from "dayjs";

const { t } = useI18n();
const columns = ref<TableProps<Partial<MenuItem>>["columns"]>([
  {
    title: "时间",
    dataIndex: "time",
  },
  {
    title: "模块",
    dataIndex: "feature",
  },
  {
    title: "操作员",
    dataIndex: "operator",
  },
  {
    title: "操作内容",
    dataIndex: "content",
  },
  {
    title: "描述",
    dataIndex: "des",
  },
]);
// const model = ref<Partial<MenuItem>>({
//   menuName: "",
//   icon: "",
//   path: "",
//   menuType: MenuType.FUNCTION,
//   orderNum: 999,
// });
// const modelRules = ["menuName", "path", "menuType", "orderNum"];
// const modelFormSetting: FormItemData<Partial<MenuItem>>[] = [
//   {
//     key: "menuName",
//     max: 32,
//     pattern: PatternKey.code,
//   },
//   {
//     key: "orderNum",
//     label: "显示排序",
//     type: FormItemComponentType.NUMBER,
//     props: {
//       min: 0,
//       max: 999,
//     },
//   },
// ];

const { pagination, tableData, tableLoading, curd, reloadTable } = useCURD<any>({
  // getDataUrl: Api.sysMenuRoutes,
  // createUrl: Api.sysMenu,
  // updateUrl: Api.sysMenu,
  // deleteUrl: Api.sysMenu,
  mockData: [
    { id: 1, time: "2024-3-25 17:00:00", feature: "进销存管理", operator: "张三", content: "新建商品", des: "成功" },
    {
      id: 2,
      time: "2024-3-25 17:00:00",
      feature: "进销存管理",
      operator: "李四",
      content: "审核付款单: F2343543534523",
      des: "成功",
    },
    {
      id: 3,
      time: "2024-3-25 17:00:00",
      feature: "抢单APP",
      operator: "王晓晓",
      content: "抢配送订单: PD324325435",
      des: "失败 | 不在配送范围",
    },
  ],
});

function showCreate() {}

function showUpdateModal(record) {}

function handleDelete(record) {}
</script>
